// CUSTOM OBJECT SCRIPT

// This script defines our custom items and creatures.

beginscendatascript;

// Our custom creature: "Death".

begindefinecreature 234;
    clear;
    cr_name = "Death";
    cr_level = 40;
    cr_hp_bonus = 400;
    cr_default_attitude = 4;
    cr_species = 8;
    cr_natural_armor = 12;
    cr_which_sheet = 502;
    cr_attack_1 = 7;
    cr_attack_1_type = 7;
    cr_immunities 0 = 100; // This creature is totally immune to all attacks!
    cr_immunities 1 = 100;
    cr_immunities 2 = 100;
    cr_immunities 3 = 100;
    cr_immunities 4 = 100;
    cr_immunities 5 = 100;

// A second custom creature: Undead Melville

begindefinecreature 235;
    clear;
    cr_name = "Undead Melville";
    cr_default_script = "specialdeath";
    cr_level = 20;
    cr_hp_bonus = 40;
    cr_default_attitude = 4;
    cr_species = 8;
    cr_natural_armor = 4;
    cr_which_sheet = 503;
    cr_attack_1 = 3;
    cr_attack_1_type = 0;
    cr_special_abil = 4; // Melee attack slows target.
    cr_immunities 0 = 0;   // Not immune to fire.
    cr_immunities 1 = 100; // Immune to cold.
    cr_immunities 2 = 20;  // Partly immune to magic.
    cr_immunities 3 = 100; // Immune to mental attacks.
    cr_immunities 4 = 100; // Immune to acid/poison.
    cr_immunities 5 = 40;  // Partly immune to melee attacks.

// Another custom creature: Weakened Death

begindefinecreature 236;
    clear;
    cr_name = "Weakened Death";
    cr_default_script = "specialdeath";
    cr_level = 20;
    cr_hp_bonus = 30;
    cr_default_attitude = 4;
    cr_species = 8;
    cr_natural_armor = 12;
    cr_which_sheet = 502;
    cr_attack_1 = 7;
    cr_attack_1_type = 7;
    cr_special_abil = 23; // Melee attack does cold damage and drains.
    cr_immunities 0 = 10; // This version is no longer immune.
    cr_immunities 1 = 10;
    cr_immunities 2 = 10;
    cr_immunities 3 = 100;
    cr_immunities 4 = 100;
    cr_immunities 5 = 10;

// Customise the default script used by skeletons (42), zombies (43), ghouls
// (44), ghasts (45), spirits (46), wights (47), ghosts (48), quickghasts
// (137), and spectres (138).  We change all these to default to our custom
// "undead" creature script.

begindefinecreature 237;
    import = 42;
begindefinecreature 42;
    cr_default_script = "undead";

begindefinecreature 238;
    import = 43;
begindefinecreature 43;
    cr_default_script = "undead";

begindefinecreature 239;
    import = 44;
begindefinecreature 44;
    cr_default_script = "undead";

begindefinecreature 240;
    import = 45;
begindefinecreature 45;
    cr_default_script = "undead";

begindefinecreature 241;
    import = 46;
begindefinecreature 46;
    cr_default_script = "undead";

begindefinecreature 242;
    import = 47;
begindefinecreature 47;
    cr_default_script = "undead";

begindefinecreature 243;
    import = 48;
begindefinecreature 48;
    cr_default_script = "undead";

begindefinecreature 244;
    import = 137;
begindefinecreature 137;
    cr_default_script = "undead";

begindefinecreature 245;
    import = 138;
begindefinecreature 138;
    cr_default_script = "undead";

// Our custom object: Death Charm.

begindefineitem 450;
    clear;
    it_name = "Charm";
    it_full_name = "Death Charm";
    it_variety = 21;
    it_special_class = 5;
    it_floor_which_sheet = 1023;
    it_floor_which_icon = 0;
    it_inventory_icon = 0;
    it_identified = 1;
    it_magic = 1;
    it_ability_1 = 207; // Calls state in scenario script when used.
    it_ability_str_1 = 10; // State number in scenario script.

// Some other miscellaneous "filler" items.

begindefineitem 451;
    clear;
    it_name = "Book";
    it_full_name = "Book";
    it_variety = 21;
    it_floor_which_sheet = 1026;
    it_floor_which_icon  = 2;
    it_inventory_icon = 2;
    it_identified = 1;
    it_magic = 0;
    it_ability_1 = 207; // Calls state in scenario script when used.
    it_ability_str_1 = 11; // State number in scenario script.

begindefineitem 452;
    clear;
    it_name = "Large Book";
    it_full_name = "Large Book";
    it_variety = 21;
    it_floor_which_sheet = 1032;
    it_floor_which_icon  = 0;
    it_inventory_icon = 1;
    it_identified = 1;
    it_magic = 0;
    it_ability_1 = 207; // Calls state in scenario script when used.
    it_ability_str_1 = 12; // State number in scenario script.

begindefineitem 453;
    clear;
    it_name = "Textbook";
    it_full_name = "Textbook";
    it_variety = 21;
    it_floor_which_sheet = 1026;
    it_floor_which_icon  = 1;
    it_inventory_icon = 1;
    it_identified = 1;
    it_magic = 0;
    it_ability_1 = 207; // Calls state in scenario script when used.
    it_ability_str_1 = 13; // State number in scenario script.

begindefineitem 454;
    clear;
    it_name = "Journal";
    it_full_name = "Journal";
    it_variety = 21;
    it_floor_which_sheet = 1026;
    it_floor_which_icon  = 0;
    it_inventory_icon = 0;
    it_identified = 1;
    it_magic = 0;
    it_ability_1 = 207; // Calls state in scenario script when used.
    it_ability_str_1 = 14; // State number in scenario script.

begindefineitem 455;
    clear;
    it_name = "Novel";
    it_full_name = "Novel";
    it_variety = 21;
    it_floor_which_sheet = 1026;
    it_floor_which_icon  = 2;
    it_inventory_icon = 2;
    it_identified = 1;
    it_magic = 0;
    it_ability_1 = 207; // Calls state in scenario script when used.
    it_ability_str_1 = 15; // State number in scenario script.

// Another custom object: a wand which unlocks a door.

begindefineitem 456;
	import = 282;
	it_full_name = "Wand of Opening";
	it_floor_which_sheet = 1030;
	it_floor_which_icon = 8;
	it_inventory_icon = 9;
	it_icon_adjust = 2;
	it_ability_1 = 107;
	it_ability_str_1 = 20;
	it_value = 100;
	it_identified = 0;

// ##########################################################################
// vim: wrap linebreak textwidth=0 shiftwidth=4 syntax=cpp
